//
//  UIInterfaceOrientationMask+Extension.swift
//  Library_y
//
//  Created by JC on 2023/6/6.
//

import UIKit

public extension UIInterfaceOrientationMask {
    
    /// 对应的 UIInterfaceOrientation
    var matchUIInterfaceOrientation: UIInterfaceOrientation {
        switch self {
        case UIInterfaceOrientationMask.portrait:
            return .portrait
        case UIInterfaceOrientationMask.landscapeLeft:
            return .landscapeLeft
        case UIInterfaceOrientationMask.landscapeRight:
            return .landscapeRight
        case UIInterfaceOrientationMask.portraitUpsideDown:
            return .portraitUpsideDown
        case UIInterfaceOrientationMask.landscape:
            return .landscapeRight
        case UIInterfaceOrientationMask.all:
            return .portrait
        case UIInterfaceOrientationMask.allButUpsideDown:
            return .portraitUpsideDown
        default:
            return .portrait
        }
    }
    
}

